<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>文章评论处理</title>
</head>
<body>
<div style="width:100%">
    <div class="items clearfix">
        <h2 style="" class="tal">文章评论处理</h2>

        <div class="items2">

            <form id="replyForm" name="replyForm" onsubmit="return false;">
                <table>
                    <tr>
                        <th width="200">会员</th>
                        <th width="*">评论</th>
                    </tr>
                    <tr>
                        <td><!--{$articleCommentInfo->creator}--></td>
                        <td>
                            提交于：<!--{$articleCommentInfo->createTime}-->|
                            评论文章标题：<!--{$articleCommentInfo->article_title}-->
                        </td>
                    </tr>
                    <tr>
                        <td>
                            IP地址：<!--{$articleCommentInfo->ipAddress}-->
                        </td>
                        <td>
                            <!--{$articleCommentInfo->commentInfo}-->
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-top:15px;">评论回复</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <textarea style="width:100%;" id="answerInfo" name="answerInfo"><!--{$articleCommentInfo->answerInfo}--></textarea>
                            <input type="hidden" id="uuid" name="uuid" value="<!--{$articleCommentInfo->uuid}-->">
                        </td>
                    </tr>
                </table>
            </form>

        </div>
    </div>

    <div class="bottom_fixbox">
        <div class="rectbox tac">
            <input type="button" class="btn" onclick="source.check();" value="处理">
            <input type="button" class="btn" onclick="E.closeWindows();" value="关闭">
        </div>
    </div>
</div>

<script>

    $().ready(function(){
        $("#answerInfo").focus();
    })

    var source = {

        dt:"",

        //检测是否填写表单
        check: function(){

            this.dt = E.getFormValues('replyForm');

            var answerInfo = E.trim($('#answerInfo').val());
            var error_msg = '';

            if ( this.dt.answerInfo == '' ){
                E.alert( '请填写回复内容' );
                return false;
            }

            E.confirm("您确认回复该评论吗？", "source.edit");
        },

        edit: function(){
            $.ajax({
                type: "POST",
                url: "/invokingAjax-backend/content/article.ajax?operFlg=9",
                dataType: "JSON",
                data:this.dt,
                success: function( result_obj ) {
                    if (result_obj.code == 200) {
                        E.opener("articleComment.load");
                        E.alert(result_obj.message,  2, "E.closeWindows");
                    } else {
                        E.alert(result_obj.message);
                    }
                }
            });
        }
    };
</script>

</body>
</html>